package com.lmt.common.entity;

import java.io.Serializable;

public class Result<T> implements Serializable{

    /**
     * 请求是否成功
     */
    private Boolean success;

    /**
     * 错误代码
     */
    private ErrorCode errorCode;

    /**
     * 信息
     */
    private String message;

    /**
     * 返回的数据
     */
    private T data;

    /**
     * 加密的数据
     */
    private String encryptData;

    public Boolean getSuccess() {
        return success;
    }

    public Result<T> setSuccess(Boolean success) {
        this.success = success;
        return this;
    }

    public ErrorCode getErrorCode() {
        return errorCode;
    }

    public Result<T> setErrorCode(ErrorCode errorCode) {
        this.errorCode = errorCode;
        return this;
    }

    public String getMessage() {
        return message;
    }

    public Result<T> setMessage(String message) {
        this.message = message;
        return this;
    }

    public T getData() {
        return data;
    }

    public Result<T> setData(T data) {
        this.data = data;
        return this;
    }

    public String getEncryptData() {
        return encryptData;
    }

    public Result<T> setEncryptData(String encryptData) {
        this.encryptData = encryptData;
        return this;
    }

    @Override
    public String toString() {
        return "Result{" +
                "success=" + success +
                ", errorCode=" + errorCode +
                ", message='" + message + '\'' +
                ", data=" + data +
                ", encryptData='" + encryptData + '\'' +
                '}';
    }
}
